package spring.mybatis;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import spring.mybatis.mapper.TestMapper;

public class SqlDemoTest {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(BatisConfiguration.class);
        SqlSessionTemplate template = context.getBean(SqlSessionTemplate.class);
        TestMapper testMapper = template.getMapper(TestMapper.class);
        System.out.println(testMapper.getEbook());
    }
}
